home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr49 / 102_01.zip / PACDEFS.H < prev    next >
Text File  |  1993-06-03  |  4KB  |  187 lines

  1. #define    MINTEL    2500    /* monster intelligence level (lower is smarter) */
  2.  
  3. /* dfp */
  4. #define    BUFSIZ    100
  5. #define CONTROL_C 0x03    /* only way to get out of this */
  6. #define CLOCKRATE 4    /* CPU clock speed, in MHz */
  7. #define    MAXPAC    3    /* maximum number of pacmen to start */
  8. #define    MAXMONSTER    4    /* max number of monsters */
  9. #define EMPTY    'E'
  10. #define FULL    'F'
  11. #define LEFT    '4'
  12. #define RIGHT    '6'
  13. #define    NORTH    '8'    /* means UP, but UP defined in vsinit() */
  14. #define NNORTH    'w'
  15. #define    DOWN    '2'
  16. #define NDOWN    'x'
  17. #define HALT    '5'
  18. #define DELETE    '\177'
  19. #define ABORT    ('\\'-0x40)
  20. #define QUIT    'q'
  21. #define CNTLS    ('S'-0x40)
  22. #define BUF_SIZE    32
  23. #define    TRUE    1
  24. #define    FALSE    0
  25. #define    UPINT    (-1)
  26. #define    DOWNINT    1
  27. #define    LEFTINT    (-2)
  28. #define    RIGHTINT    2
  29.  
  30. /* Codes with 0200 bit set are special graphics characters, for board
  31.  *   display (SAW)
  32.  */
  33.  
  34. #define    PACMAN    ('@' | 0200)
  35. #define    MONSTER    ('M' | 0200)
  36. #define    RUNNER    ('S' | 0200)
  37. #define    TREASURE    ('$' | 0200)
  38. #define    CHOICE        ('*' | 0200)
  39. #define    GOLD        ('+' | 0200)
  40. #define    POTION        ('X' | 0200)
  41. #define    VACANT        (' ' | 0200)    /* space */
  42. #define    WALL        ('O' | 0200)
  43. #define    GATE        ('-' | 0200)
  44. #define PUP    ('^' | 0200)
  45. #define PDOWN    ('v' | 0200)
  46. #define PLEFT    ('<' | 0200)
  47. #define PRIGHT    ('>' | 0200)
  48.  
  49. #define    START    0
  50. #define    RUN    1
  51. #define    FAST    1
  52. #define    SLOW    0
  53. #define    PSTARTX    18
  54. #define    PSTARTY    17
  55. #define    MSTARTX    16    /* monster starting position */
  56. #define    MSTARTY    10    /* monster starting position */
  57. #define    MBEGINX    18    /* monster beginning position */
  58. #define    MBEGINY    7    /* monster beginning position */
  59. #define    TRYPOS    13
  60. #define    TRXPOS    20
  61. #define    GOTONE    1
  62. #define    TURKEY    (-1)
  63. #define    DUP    1
  64. #define    DDOWN    4
  65. #define    DRIGHT    3
  66. #define    DLEFT    2
  67. #define    DNULL    0
  68. #define    BRDX    40
  69. #define    BRDY    23
  70. #define XWRAP    38
  71. #define    TREASVAL    20
  72. #define    KILLSCORE    10
  73. #define    BEEP        07    /* ctrl-g */
  74. #define    MSTARTINTVL    10
  75. #define    POTINTVL    25
  76. #define GOLDCNT    185
  77.  
  78. struct    pac
  79. {
  80.     int    xpos;    /* horizontal position */
  81.     int    ypos;    /* vertical   position */
  82.     int    dirn;    /* direction of travel */
  83.     int    dirx;    /* desired direction of travel */
  84.     int    speed;    /* FAST/SLOW           */
  85.     int    danger;    /* TRUE if can eat     */
  86.     int    stat;    /* status        */
  87. };
  88.  
  89. #define nap(x)  
  90.  
  91. /* Global variable definitions (saw)            */
  92.  
  93. /*
  94.  * initbrd is used to re-initialize the display
  95.  * array once a new game is started.
  96.  */
  97. char    initbrd[BRDY][BRDX];
  98.  
  99. /*
  100.  * brd is kept for historical reasons.
  101.  * It should only be used in the routine "which"
  102.  * to determine the next move for a monster or
  103.  * in the routine "monster" to determine if it
  104.  * was a valid move. Admittedly this is redundant
  105.  * and could be replaced by initbrd, but it is kept
  106.  * so that someday additional intelligence or
  107.  * optimization could be added to the choice of
  108.  * the monster's next move. Hence, note the symbol
  109.  * CHOICE at most points that a move decision
  110.  * logically HAS to be made.
  111.  */
  112. char    brd[BRDY][BRDX];
  113. /*
  114.  * display reflects the screen on the player's
  115.  * terminal at any point in time.
  116.  */
  117. char    display[BRDY][BRDX];
  118.  
  119. int lastchar;
  120.  
  121. char    combuf[BUFSIZ],
  122.     message[81],    /* temporary message buffer */
  123.     inbuf[2];
  124.  
  125. int    ppid,
  126.     cpid,
  127.     game,
  128.     killcnt,
  129.     vs_rows,
  130.     vs_cols;
  131.  
  132. unsigned
  133.     pscore;
  134.  
  135. /* long    timein;        */
  136. unsigned    timein;
  137.  
  138.  
  139. /* from monster.c:            */
  140.  
  141.  
  142. int    rscore[MAXMONSTER];
  143.  
  144. struct pac
  145.     monst[MAXMONSTER];
  146.  
  147.  
  148.  
  149. /*
  150.  * global variables from pacman.c
  151.  */
  152.  
  153.  
  154. int    pacsymb,
  155.     rounds,        /* time keeping mechanism */
  156.     killflg,
  157.     delay,
  158.     potion,
  159.     goldcnt,        /* no. of gold pieces remaining */
  160.     potioncnt;
  161.  
  162. struct pac
  163.     Pac;
  164.  
  165. struct pac
  166.     pacstart;
  167.  
  168.  
  169. struct pac
  170.     *pacptr;
  171.  
  172.     int ospeed;        /* baud rate for crt (for tputs()) */
  173.  
  174. char    Freeze;            /* true on ^S typed.            */
  175. char    InpChar;
  176. char    rev, graph;        /* reverse video, graphic modes.    */
  177.  
  178. #define    SCFILE    "pacman.rec"    /* file is 512 bytes long.        */
  179. char    UpdSc;            /* 1 means update score file.        */
  180.  
  181. struct Record {            /* for top 8 games:            */
  182.     int Score;        /* 64 bytes/record            */
  183.     char Name[62];
  184.     } Scores[10];
  185.  
  186. char    jbuf[6];        /* setjmp/longjmp buffer        */
  187.